package cn.pugle.ormtest.hibernate.dto;

import cn.pugle.ormtest.hibernate.model.CustomerModel3;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.OneToOne;

/**
 * \@Sql表示不对应数据库表
 *
 * @author tzp
 * @date 2017/12/27
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class CustomerDetail {
    @OneToOne
    private CustomerModel3 customer;

    private Long orderCount;

    public CustomerDetail(Long customerId, String customerName, Long orderCount) {
        this.customer = new CustomerModel3(customerId, customerName, null);
        this.orderCount = orderCount;
    }
}
